/*
* @Author: Rosen
* @Date:   2017-05-23 19:33:33
* @Last Modified by:   Administrator
* @Last Modified time: 2017-11-30 12:03:24
*/

$(function(){
    $("footer").load("layout/footer.html");
    $("header").load("layout/header2.html");

var navHtml=$('#nav').html();
var ad1Html=$('#ad1').html();

 $(function() {
              $.ajax({
                       type:"get",
                       url:"data/usernav.json",
                       async:true,
                       success: function(data){
                        console.log(data.nav.length);
                        var navdata=data.nav
                        var ad1data=data.ad1
                        $('.box-left').html(doT.template(navHtml)(navdata));
                        $('.ad1').html(doT.template(ad1Html)(ad1data));
                       },
                       error: function(XMLHTTPRequest, textStatus, errorThrown){
                         console.log("XMLHttpRequest :"+ XMLHTTPRequest);
                         console.log("textStatus :"+textStatus);
                         console.log("errorThrown :"+errorThrown);
                       }
                     });
             
       
    });
 $(document).on("click",".navlis-list",function(){
        $(this).addClass("changered").siblings().removeClass("changered")
        var url = $(this).attr('href');
        $("#J_iframe").attr('src',url);
        return false;
    });
 
});